Optimal. Leaf size=136 \[ \frac{x \left (-3 i c^2 d+c^3-3 c d^2-3 i d^3\right )}{4 a^2}+\frac{(c+i d)^2 (3 d+i c)}{4 a^2 f (1+i \tan (e+f x))}+\frac{d^3 \log (\cos (e+f x))}{a^2 f}+\frac{(-d+i c) (c+d \tan (e+f x))^2}{4 f (a+i a \tan (e+f x))^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.302602, antiderivative size = 136, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 28, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.179, Rules used = {3558, 3589, 3475, 3526, 8} \[ \frac{x \left (-3 i c^2 d+c^3-3 c d^2-3 i d^3\right )}{4 a^2}+\frac{(c+i d)^2 (3 d+i c)}{4 a^2 f (1+i \tan (e+f x))}+\frac{d^3 \log (\cos (e+f x))}{a^2 f}+\frac{(-d+i c) (c+d \tan (e+f x))^2}{4 f (a+i a \tan (e+f x))^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3558
Rule 3589
Rule 3475
Rule 3526
Rule 8
Rubi steps
\begin{align*} \int \frac{(c+d \tan (e+f x))^3}{(a+i a \tan (e+f x))^2} \, dx &=\frac{(i c-d) (c+d \tan (e+f x))^2}{4 f (a+i a \tan (e+f x))^2}-\frac{\int \frac{(c+d \tan (e+f x)) \left (-2 a \left (c^2-2 i c d+d^2\right )+4 i a d^2 \tan (e+f x)\right )}{a+i a \tan (e+f x)} \, dx}{4 a^2}\\ &=\frac{(i c-d) (c+d \tan (e+f x))^2}{4 f (a+i a \tan (e+f x))^2}+\frac{i \int \frac{-2 a^2 c \left (2 c d+i \left (c^2+d^2\right )\right )-2 a^2 d \left (i c^2+4 c d+3 i d^2\right ) \tan (e+f x)}{a+i a \tan (e+f x)} \, dx}{4 a^3}-\frac{d^3 \int \tan (e+f x) \, dx}{a^2}\\ &=\frac{d^3 \log (\cos (e+f x))}{a^2 f}+\frac{(c+i d)^2 (i c+3 d)}{4 f \left (a^2+i a^2 \tan (e+f x)\right )}+\frac{(i c-d) (c+d \tan (e+f x))^2}{4 f (a+i a \tan (e+f x))^2}+\frac{\left (c^3-3 i c^2 d-3 c d^2-3 i d^3\right ) \int 1 \, dx}{4 a^2}\\ &=\frac{\left (c^3-3 i c^2 d-3 c d^2-3 i d^3\right ) x}{4 a^2}+\frac{d^3 \log (\cos (e+f x))}{a^2 f}+\frac{(c+i d)^2 (i c+3 d)}{4 f \left (a^2+i a^2 \tan (e+f x)\right )}+\frac{(i c-d) (c+d \tan (e+f x))^2}{4 f (a+i a \tan (e+f x))^2}\\ \end{align*}
Mathematica [B] time = 2.14423, size = 305, normalized size = 2.24 \[ -\frac{\sec ^2(e+f x) \left (\cos (2 (e+f x)) \left (3 c^2 d (-1-4 i f x)+c^3 (4 f x+i)-3 c d^2 (4 f x+i)+8 d^3 \log \left (\cos ^2(e+f x)\right )+d^3 (1+4 i f x)\right )+3 i c^2 d \sin (2 (e+f x))+12 c^2 d f x \sin (2 (e+f x))+4 i c^3 f x \sin (2 (e+f x))+c^3 \sin (2 (e+f x))+4 i c^3-3 c d^2 \sin (2 (e+f x))-12 i c d^2 f x \sin (2 (e+f x))+12 i c d^2-i d^3 \sin (2 (e+f x))-4 d^3 f x \sin (2 (e+f x))+8 i d^3 \sin (2 (e+f x)) \log \left (\cos ^2(e+f x)\right )+16 d^3 \tan ^{-1}(\tan (f x)) (\sin (2 (e+f x))-i \cos (2 (e+f x)))-8 d^3\right )}{16 a^2 f (\tan (e+f x)-i)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.034, size = 362, normalized size = 2.7 \begin{align*}{\frac{3\,{c}^{2}d}{4\,f{a}^{2} \left ( \tan \left ( fx+e \right ) -i \right ) ^{2}}}-{\frac{{d}^{3}}{4\,f{a}^{2} \left ( \tan \left ( fx+e \right ) -i \right ) ^{2}}}-{\frac{{\frac{3\,i}{8}}\ln \left ( \tan \left ( fx+e \right ) +i \right ) c{d}^{2}}{f{a}^{2}}}-{\frac{{\frac{i}{4}}{c}^{3}}{f{a}^{2} \left ( \tan \left ( fx+e \right ) -i \right ) ^{2}}}+{\frac{{\frac{3\,i}{8}}\ln \left ( \tan \left ( fx+e \right ) -i \right ) c{d}^{2}}{f{a}^{2}}}-{\frac{{\frac{i}{8}}\ln \left ( \tan \left ( fx+e \right ) -i \right ){c}^{3}}{f{a}^{2}}}-{\frac{3\,\ln \left ( \tan \left ( fx+e \right ) -i \right ){c}^{2}d}{8\,f{a}^{2}}}-{\frac{7\,\ln \left ( \tan \left ( fx+e \right ) -i \right ){d}^{3}}{8\,f{a}^{2}}}-{\frac{{\frac{3\,i}{4}}{c}^{2}d}{f{a}^{2} \left ( \tan \left ( fx+e \right ) -i \right ) }}+{\frac{{\frac{3\,i}{4}}c{d}^{2}}{f{a}^{2} \left ( \tan \left ( fx+e \right ) -i \right ) ^{2}}}+{\frac{{c}^{3}}{4\,f{a}^{2} \left ( \tan \left ( fx+e \right ) -i \right ) }}+{\frac{9\,c{d}^{2}}{4\,f{a}^{2} \left ( \tan \left ( fx+e \right ) -i \right ) }}+{\frac{3\,\ln \left ( \tan \left ( fx+e \right ) +i \right ){c}^{2}d}{8\,f{a}^{2}}}-{\frac{\ln \left ( \tan \left ( fx+e \right ) +i \right ){d}^{3}}{8\,f{a}^{2}}}+{\frac{{\frac{5\,i}{4}}{d}^{3}}{f{a}^{2} \left ( \tan \left ( fx+e \right ) -i \right ) }}+{\frac{{\frac{i}{8}}\ln \left ( \tan \left ( fx+e \right ) +i \right ){c}^{3}}{f{a}^{2}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.64889, size = 339, normalized size = 2.49 \begin{align*} \frac{{\left (16 \, d^{3} e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) +{\left (4 \, c^{3} - 12 i \, c^{2} d - 12 \, c d^{2} - 28 i \, d^{3}\right )} f x e^{\left (4 i \, f x + 4 i \, e\right )} + i \, c^{3} - 3 \, c^{2} d - 3 i \, c d^{2} + d^{3} +{\left (4 i \, c^{3} + 12 i \, c d^{2} - 8 \, d^{3}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} e^{\left (-4 i \, f x - 4 i \, e\right )}}{16 \, a^{2} f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 3.51069, size = 394, normalized size = 2.9 \begin{align*} \begin{cases} \frac{\left (\left (16 i a^{2} c^{3} f e^{4 i e} + 48 i a^{2} c d^{2} f e^{4 i e} - 32 a^{2} d^{3} f e^{4 i e}\right ) e^{- 2 i f x} + \left (4 i a^{2} c^{3} f e^{2 i e} - 12 a^{2} c^{2} d f e^{2 i e} - 12 i a^{2} c d^{2} f e^{2 i e} + 4 a^{2} d^{3} f e^{2 i e}\right ) e^{- 4 i f x}\right ) e^{- 6 i e}}{64 a^{4} f^{2}} & \text{for}\: 64 a^{4} f^{2} e^{6 i e} \neq 0 \\x \left (- \frac{c^{3} - 3 i c^{2} d - 3 c d^{2} - 7 i d^{3}}{4 a^{2}} + \frac{\left (c^{3} e^{4 i e} + 2 c^{3} e^{2 i e} + c^{3} - 3 i c^{2} d e^{4 i e} + 3 i c^{2} d - 3 c d^{2} e^{4 i e} + 6 c d^{2} e^{2 i e} - 3 c d^{2} - 7 i d^{3} e^{4 i e} + 4 i d^{3} e^{2 i e} - i d^{3}\right ) e^{- 4 i e}}{4 a^{2}}\right ) & \text{otherwise} \end{cases} + \frac{d^{3} \log{\left (e^{2 i f x} + e^{- 2 i e} \right )}}{a^{2} f} + \frac{x \left (c^{3} - 3 i c^{2} d - 3 c d^{2} - 7 i d^{3}\right )}{4 a^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.9154, size = 305, normalized size = 2.24 \begin{align*} -\frac{\frac{2 \,{\left (-i \, c^{3} - 3 \, c^{2} d + 3 i \, c d^{2} + d^{3}\right )} \log \left (\tan \left (f x + e\right ) + i\right )}{a^{2}} + \frac{2 \,{\left (i \, c^{3} + 3 \, c^{2} d - 3 i \, c d^{2} + 7 \, d^{3}\right )} \log \left (\tan \left (f x + e\right ) - i\right )}{a^{2}} + \frac{-3 i \, c^{3} \tan \left (f x + e\right )^{2} - 9 \, c^{2} d \tan \left (f x + e\right )^{2} + 9 i \, c d^{2} \tan \left (f x + e\right )^{2} - 21 \, d^{3} \tan \left (f x + e\right )^{2} - 10 \, c^{3} \tan \left (f x + e\right ) + 30 i \, c^{2} d \tan \left (f x + e\right ) - 18 \, c d^{2} \tan \left (f x + e\right ) + 22 i \, d^{3} \tan \left (f x + e\right ) + 11 i \, c^{3} + 9 \, c^{2} d + 15 i \, c d^{2} + 5 \, d^{3}}{a^{2}{\left (\tan \left (f x + e\right ) - i\right )}^{2}}}{16 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]